import { EntityManager, QueryBuilder, SqlEntityManager } from '@mikro-orm/mysql';
import { OrderJobEnrolls } from '@entities/OrderJobEnrolls';

type ObjectVOField = keyof OrderJobEnrolls

export class OrderJobEnrollsVO {
    // static baseInfo() :  ObjectVOField [] {
    //     return [
    //         'id',
    //         'nickname',
    //         'sex',
    //         'headIconUrl',
    //         'phoneNumber',
    //         'name',
    //         'roles'
    //     ]
    // }

    static calcStepStatus(enroll)
    {
        let state_step = 0

        while (true) {
            if(!enroll.assigned_job_at) {state_step = 1;break;}
            if(!enroll.sign_up_at) {state_step = 2;break;}
            if(!enroll.sign_down_at) {state_step = 3;break;}
            if(!enroll.verified_at) {state_step = 4;break;}
            if(!enroll.give_salary_at) {state_step = 5;break;}
            if(!enroll.finish_at) {state_step = 6;break;}                    
            break
        }

        return state_step
    }
}
